/*
 * @Author: kls
 * @Date: 2023-03-13 12:41:38
 * @LastEditTime: 2023-03-14 12:40:16
 * @LastEditors: kls
 * @Description: 
 * @FilePath: \jnks-shengpingtai\src\router\index.js
 */
import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)
// 解决重复点击路由报错的BUG
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalPush.call(this, location).catch((err) => err)
}

const routes = [
  {
    path: '/',
    name: 'layout',
    redirect: "/home",
    meta: { index: 0, mark: "layout" },
    component: () => import('@/views/Layout/index.vue'),
    children: [
      {
        path: "/home",
        name: "home",
        meta: { index: 1, mark: "首页" },
        component: () => import("@/views/shengpingtai/home/index.vue"),
      }
    ]
  },
  {
    path: "/login",
    name: "login",
    meta: { index: 2, mark: "登录页" },
    component: () => import("@/views/login/index.vue"),
  }
]

const router = new VueRouter({
  routes
})

export default router
